#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(this, &Widget::MySignal, this, &Widget::handleClicked);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handleClicked(const QString& text)
{
        this->setWindowTitle(text);
}

void Widget::on_pushButton_clicked()
{
    emit MySignal("设置窗口标题为文本内容1");
}

void Widget::on_pushButton_2_clicked()
{
    emit MySignal("设置窗口标题为文本内容2");
}
